package ua.dogar.test;

import java.io.IOException;

import ua.dogar.threads.Keeper;
import ua.dogar.threads.VectorReaderMyThread;
import ua.dogar.threads.VectorWriterMyThread;
import ua.dogar.vectors.ArrayVector;



public class Main {

	public static void main(String[] args) throws CloneNotSupportedException,
			IOException, InterruptedException {
		ArrayVector vec = new ArrayVector(250);
		/*
		 * ArrayVector vec = new ArrayVector(5); Vector synVec =
		 * Vectors.getSynchronizedVector(vec); Thread th1 = new
		 * VectorWriterThread(synVec); Thread th2 = new
		 * VectorReaderThread(synVec);
		 */
		//1
		
		/*Thread th1 = new VectorWriterThread(vec);
		Thread th2 = new VectorReaderThread(vec);
		// th1.setPriority(Thread.MAX_PRIORITY);
		// th2.setPriority(Thread.MIN_PRIORITY);
		th1.start();
		//th1.join();
		th2.start();
		//th2.join();*/
		 
		
		  Keeper kp = new Keeper(vec);
		  VectorReaderMyThread myTh1 = new
		  VectorReaderMyThread(kp); VectorWriterMyThread myTh2 = new
		  VectorWriterMyThread(kp); Thread th = new Thread(myTh1); Thread th2 =
		  new Thread(myTh2); th.start(); th2.start();
		 
	
	}

}
